﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using System.Diagnostics;

namespace sonicERPinterfaceCsharp.Forms
{
    public partial class Form3 : Form
    {
        private int i;

        public Form3()
        {
            InitializeComponent();
            i = 0;
        }

        public void processos()
        {
            listBox1.Items.Clear();
            foreach (Process  item in Process.GetProcesses() )
            {
               
                listBox1.Items.Add(item.ProcessName + " " + item.Responding.ToString() + "  " + 
                    item.HandleCount.ToString());
            }
        }

            

        private void button1_Click(object sender, EventArgs e)
        {
           
            timer1.Enabled = true;
              processos();
              i = 0;

           


        }

        private void button2_Click(object sender, EventArgs e)
        {

       
        Process.Start("excel.exe");
          
        }

        private void button3_Click(object sender, EventArgs e)
        {
            listBox1.Items.Clear();
          
            foreach (Control item in this.Controls)
            {
               

                {

                listBox1.Items.Add(item.Name + "" + item.GetType() );
                
               
                }
            }
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            progressBar1.Value = i;
            if (i<100)
            {
                i += 1;
            }
            else
            {
                timer1.Enabled = false;
            }
           
        }

        private void button4_Click(object sender, EventArgs e)
        {
            this.Show();

        }
    }
}
